/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */
package com.gskorupa.univermon.versatile;

import java.util.ArrayList;

/**
 *
 * @author greg
 */
public class Report {

    private String query;
    private String user;
    private String limit;
    private int results = 0;
    private boolean fifo = true;
    private ArrayList entities;

    public Report() {
        entities = new ArrayList();
    }

    public void append(ReportEntity ent) {
        getEntities().add(ent);
    }

    /**
     * @return the query
     */
    public String getQuery() {
        return query;
    }

    /**
     * @param query the query to set
     */
    public void setQuery(String query) {
        this.query = query.trim();
    }

    /**
     * @return the client
     */
    public String getUser() {
        return user;
    }

    /**
     * @param client the client to set
     */
    public void setUser(String user) {
        this.user = user;
    }

    /**
     * @return the counter
     */
    public int getResults() {
        return results;
    }

    /**
     * @return the entities
     */
    public ArrayList getEntities() {
        return entities;
    }

    public int getSize() {
        return entities.size();
    }

    /**
     * @return the maxResults
     */
    public String getLimit() {
        return limit;
    }

    /**
     * @param limit the maxResults to set
     */
    public void setLimit(String limit) {
        this.limit = limit;
    }

    /**
     * @param results the results to set
     */
    public void setResults(int results) {
        this.results = results;
    }

    /**
     * @return the fifo
     */
    public boolean isFifo() {
        return fifo;
    }

    /**
     * @param fifo the fifo to set
     */
    public void setFifo(boolean fifo) {
        this.fifo = fifo;
    }

    public void setFifo(String fifo) {
        if (fifo != null) {
            this.fifo = !fifo.equalsIgnoreCase("false");
        }
    }
    
    public void clear(){
        entities.clear();
    }
}
